<script>
  import http from '@/utils/request.js'
  import { checkBlack } from '@/api'

  export default {
    onLaunch: function () {
      checkBlack().then((res) => {
        uni.setStorage({
          key: 'isBlack',
          data: res.data
        })
        if (!res.data) {
          uni.reLaunch({
            url: '/pages/login/login'
          })
        }
      })

      http.get('/api/free/service/partner/list').then(({ partner, serviceInfo }) => {
        uni.setStorage({
          key: 'serviceInfo',
          data: serviceInfo
        })
        uni.setStorage({
          key: 'partner',
          data: partner
        })
      })
    },
    onShow: function () {
      console.log('App Show')
    },
    onHide: function () {
      console.log('App Hide')
    }
  }
</script>

<style lang="scss">
  /* 隐藏全局滚动条 - 针对 WebKit 内核浏览器 (Chrome, Safari, Edge) */
  ::-webkit-scrollbar {
    display: none !important;
    /* 直接隐藏滚动条 */
    width: 0 !important;
    /* 设置滚动条宽度为 0 */
    height: 0 !important;
    /* 设置滚动条高度为 0 */
    background: transparent !important;
    /* 设置滚动条背景为透明，增强隐藏效果 */
  }

  /* 兼容 Firefox 浏览器 */
  html,
  body {
    scrollbar-width: none !important;
    /* Firefox 下隐藏滚动条 */
  }

  /* 兼容 IE 10+ 和 Edge (旧版) */
  body {
    -ms-overflow-style: none !important;
    /* IE 和 Edge 隐藏滚动条 */
  }

  /* 可选：防止横向溢出，增强视觉一致性 */
  html,
  body {
    overflow-x: hidden !important;
  }

  /*每个页面公共css */
  .public-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 32rpx;
  }

  .public-box {
    width: 100%;
    height: 100%;
    padding: 20rpx 0 40rpx;
  }

  .public-btn {
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
    background: #fff;

    .btn-box {
      padding: 20rpx 32rpx 68rpx;
    }
  }

  /** 表单输入框样式 ============开始  */
  .cb-input-title {
    font-size: 34rpx;
    color: #9ca5ad;
    padding-left: 48rpx;
    margin: 20rpx 0 10rpx;
  }

  .cb-input {
    // width: 100%;
    height: 96rpx;
    border-radius: 64rpx;
    border: 2rpx solid #666666;
    padding: 0 48rpx;

    .uni-input-wrapper {
      width: 100%;
    }
  }

  .cb-selection {
    height: 96rpx;
    padding-bottom: 10rpx;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 64rpx;
    border: 2rpx solid #666666;
    padding: 0 48rpx;

    .selection-inactive {
      color: #9ca5ad;
    }

    .selection-active {
      color: #000000;
    }
  }

  /** 表单输入框样式 ============结束  */

  .public-title {
    box-sizing: border-box;
    font-family: 'Pretendard K Edition';
    color: #020616;
    font-size: 46rpx;
    font-weight: 700;
    line-height: 135%;
    letter-spacing: 0;
    white-space: pre-line;
  }

  .public-desc {
    box-sizing: border-box;
    font-family: 'Pretendard K Edition';
    color: #3b4659;
    font-size: 30rpx;
    font-weight: 400;
    line-height: 160%;
    letter-spacing: -2rpx;
    white-space: pre-line;
    margin: 40rpx 0 60rpx;
  }

  .public-list-index {
    .partner-title {
      width: 86%;
      font-weight: 700;
      font-size: 42rpx;
      line-height: 60rpx;
      color: #fff;
      letter-spacing: -4rpx;
    }

    .partner-name {
      margin: 40rpx 0;
      width: 86%;
      font-weight: 400;
      font-size: 28rpx;
      line-height: 40rpx;
      color: #fff;
      letter-spacing: -2rpx;
      white-space: pre-line;
    }

    .item-title {
      font-weight: 700;
      font-size: 32rpx;
      color: #fff;
      margin-bottom: 20rpx;
    }

    .item-img {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      grid-gap: 30rpx;
      margin-bottom: 40rpx;

      .v-img {
        background: #fff;
        height: 120rpx;
        border-radius: 30rpx;
        overflow: hidden;
      }
    }

    .company-img {
      height: 390rpx;
      background: #fff;
      border-radius: 30rpx;
      overflow: hidden;
      margin: 80rpx 0;
    }

    .item-com {
      color: #fff;
      font-weight: 400;
      font-size: 28rpx;

      &:nth-child(even) {
        margin: 28rpx 0 20rpx;
        font-weight: 700;
        letter-spacing: 0;
        font-size: 26rpx;
      }
    }
  }

  .public-form_index {
    padding: 0 56rpx;

    .public-form_top {
      margin-top: 48rpx;
    }

    .public-form_input,
    .public-form_code {
      border-radius: 64rpx;
      border: 2rpx solid #666666;
      padding: 28rpx 48rpx;
      font-size: 28rpx;
    }

    .public-form_input {
      height: 40rpx;
    }

    .public-form_code {
      height: 96rpx;
      display: flex;
      align-items: center;
      padding: 0 48rpx;

      input {
        flex: 1;
        font-size: 28rpx;
      }

      .code {
        padding-right: 48rpx;
      }

      .password {
        padding-right: 28rpx;
      }
    }

    .public-bottom_text {
      margin-top: 24rpx;
      display: flex;
      justify-content: space-between;

      text {
        font-family: PingFang SC, PingFang SC;
        font-weight: 500;
        font-size: 28rpx;
        color: #999999;
        text-align: right;
        font-style: normal;
        text-transform: none;

        // 第一个元素
        &:first-child {
          color: #3462fe;
        }
      }
    }

    .public-bottom_btn {
      margin-top: 112rpx;

      button {
        background: #3462fe;
        border-radius: 64rpx;
        height: 100rpx;
        line-height: 100rpx;
        font-family: PingFang SC, PingFang SC;
        font-weight: bold;
        font-size: 32rpx;
        color: #ffffff;
        text-align: center;
        font-style: normal;
        text-transform: none;
      }
    }
  }

  /** 电话按钮 */
  .public-bottom_phone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 54rpx 0 150rpx;

    .phone-text {
      font-family: PingFang SC, PingFang SC;
      font-weight: 500;
      font-size: 28rpx;
      color: #3462fe;
      text-align: center;
      font-style: normal;
      text-transform: none;
    }

    .phone {
      width: 64rpx;
      height: 64rpx;
      background: #8694b1;
      border-radius: 64rpx;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 24rpx;
    }
  }

  /** 顶部导航栏样式  */
  .top-bar {
    background: rgba(222, 233, 245, 0.3);

    .uni-navbar__header {
      // 透明背景色
      // opacity: .5;
      // background: transparent !important;
      backdrop-filter: blur(25px) !important;
      padding: 0 !important;
      position: relative !important;
    }

    .left-icon {
      padding-left: 32rpx;
    }

    .right-icon {
      padding-right: 32rpx;

      .top-app_download {
        position: absolute;
        right: 16%;
        top: 26rpx;
        width: 124rpx;
        height: 52rpx;
        line-height: 52rpx;
        border-radius: 8rpx;
        border: 2rpx solid #3462fe;
        font-family: PingFang SC, PingFang SC;
        font-weight: 500;
        font-size: 24rpx;
        color: #3462fe;
        text-align: center;
        font-style: normal;
        text-transform: none;
        z-index: 2;
      }
    }
  }
</style>
